<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>传感器数据</title>
    <link rel="stylesheet" href="/static/style.css">
</head>
<body>

    <div class="content">
        <h1>传感器数据</h1>

        <!-- 车辆ID和日期显示 -->
        <p>车辆ID：{{ car_id }}， 日期：{{ date }}</p>

        <table>
            <thead>
                <tr>
                    <th>传感器ID</th>
                    <th>数据内容</th>
                    <th>时间</th>
                </tr>
            </thead>
            <tbody>
                {% for data in sensor_data %}
                    <tr>
                        <td>{{ data[0] }}</td>
                        <td>{{ data[1] }}</td>
                        <td>{{ data[2] }}</td>
                    </tr>
                {% endfor %}
            </tbody>
        </table>

        <!-- 分页按钮 -->
        <div class="pagination">
            {% if page > 1 %}
                <a href="/search_by_car_and_date?car_id={{ car_id }}&date={{ date }}&page={{ page-1 }}">上一页</a>
            {% endif %}
            <span>第 {{ page }} 页，共 {{ total_pages }} 页</span>
            {% if page < total_pages %}
                <a href="/search_by_car_and_date?car_id={{ car_id }}&date={{ date }}&page={{ page+1 }}">下一页</a>
            {% endif %}
        </div>

    </div>
</body>
</html>
